<template>
  <view>
    测试prop
    {{ num }}
    <button @click="add">添加</button>
  </view>
</template>
<script setup>
import { useAttrs, ref, onUnmounted } from 'vue'

onUnmounted(() => {
  console.log(`helloworld`)
})
const props = defineProps({
  num: Number
})
const { name } = props
const emits = defineEmits(['change'])

const add = () => {
  emits('change', 111)
}

defineExpose({
  add
})
</script>
